package com.lzj.server.common.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lzj.server.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;

@Schema(name = "Attachment", description = "通用附件表，存储所有上传的资源文件")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("attachment")
public class Attachment extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 946209284070820921L;


    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键，自增")
    private Long id;
    @TableField("file_name")
    @Schema(description = "原始文件名")
    private String fileName;
    @TableField("path")
    @Schema(description = "存储路径")
    private String path;
    @TableField("file_type")
    @Schema(description = "文件类型")
    private String fileType;
    @TableField("file_size")
    @Schema(description = "文件大小（字节）")
    private Long fileSize;
    @TableField("format")
    @Schema(description = "附件格式，如 .mp4, .jpg")
    private String format;
    @TableField("uploader_id")
    @Schema(description = "上传者 ID")
    private Long uploader;
    @TableField("duration")
    @Schema(description = "视频时长（秒）")
    private Integer duration;


}

